<app-content-header 
 [search]="search"  
 (actionClick)="goNew()"
 [action]="action"
 >
  <ng-template #search>
    <app-search [(data)]="searchSchema" [customItems]="customSchema" (bindSearch)="handleSearch()"></app-search>
  </ng-template>

  <ng-template #action>
    <i nz-icon type="plus"></i> {{ 'MENU.BIZ.BATCH_REGISTER' | translate }}
  </ng-template>
</app-content-header>

<div class="cil-table-block">
  <st
    #st
    [scroll]="scroll"
    [data]="data"
    [columns]="columns"
    [widthMode]="widthMode"
    [ps]="ps"
    [pi]="pi"
    [page]="stPage"
    [total]="total"
    [loading]="loading"
    (change)="onChange($event)"
  >
    <ng-template st-row="number" let-item let-index="index">
          {{index+1}}
    </ng-template>
    <ng-template st-row="result" let-item>
      <span>{{ BatchStatusTextMap[item.result] | i18n}}</span>
    </ng-template>
  </st>

    <div *ngIf="!loading && !showButton" #btns class="cil-custom-btns">
      <button
      acl [acl-ability]="'api.post.camel.import.sample.upload'"
      class="cil__custom-btn__lightblue"
      nz-button
      nzType="primary"
      nzShape="round"
      nzSize="default"
      (click)="upload()"
    >
      <i nz-icon type="upload"></i>
      {{'BATCH.IMPORT.FILE.ADD' | i18n}}
    </button>
    <button
      class="cil__custom-btn__lightblue"
      nz-button
      nzType="primary"
      nzShape="round"
      nzSize="default"
      (click)="download()"
    >
      <i nz-icon type="download"></i>
      {{'BATCH.IMPORT.FILE.DOWNLOAD' | i18n}}
    </button>
  </div>
</div>

<div  *ngIf="showButton && !loading" #btns class="cil-custom-btns" style="text-align: right;">
  <button
  acl [acl-ability]="'api.post.camel.import.sample.upload'"
  class="cil__custom-btn__lightblue"
  nz-button
  nzType="primary"
  nzShape="round"
  nzSize="default"
  (click)="upload()"
>
  <i nz-icon type="upload"></i>
  {{'BATCH.IMPORT.FILE.ADD' | i18n}}
</button>
<button
  class="cil__custom-btn__lightblue"
  nz-button
  nzType="primary"
  nzShape="round"
  nzSize="default"
  (click)="download()"
>
  <i nz-icon type="download"></i>
  {{'BATCH.IMPORT.FILE.DOWNLOAD' | i18n}}
</button>
</div>
